<!--获取当前nva栏子项标志位-->
<#assign calias = "default">
<#if Catalog?has_content>
    <#assign firstAncestor = Catalog.ancestors?split(':')[0]>
    <@cms_catalog id="${firstAncestor}" level="Self">
        <#list DataList as c1>
            <#assign calias = c1.alias>
        </#list>
    </@cms_catalog>
</#if>
<script>
    function goLink(){
        var link = "${IsPreview?then(ApiPrefix, Prefix)}_search${IsPreview?then('?sid='+Site.siteId+'&pp='+PublishPipeCode+'&preview=true', '')}";
        if (link.indexOf('?') > -1) {
            link += "&q=" + $('#header_search').val();
        } else {
            link += "?q=" + $('#header_search').val();
        }
        window.location.href = link +  "&Authorization=" + new URL(window.location.href).searchParams.get('Authorization');
    }
    window.onload = function() {  
		document.getElementById('header_search').addEventListener('keyup', function(event) {  
		  if (event.key === 'Enter') {
			goLink()
		  }  
		}); 

        document.getElementById('btn-search').addEventListener('click', function(event) {  
			goLink()
		}); 

        document.getElementById('btn-reset').addEventListener('click', function(event) {  
			$('#header_search').val('');
		}); 

        // 获取当前页面的域名
        var currentDomain = window.location.hostname;

        // 更新链接的 href 属性为当前域名
        document.getElementById('go-other-link1').href = '//' + currentDomain + ':85';
        document.getElementById('go-other-link3').href = '//' + currentDomain + ':84';

	};
</script>

<div class="h-top wow fadeInLef">
    <div class="center">
        <div class="container">
            <div class="row">
                <div class="col col-lg-6 h-top-l" >
                    欢迎访问西充县政策服务专栏！
                </div>
                <div class="col col-lg-6 h-top-r">
                    <span style="font-weight: 700;">快速导航：</span>
                    <a id="go-other-link1" target="_blank" rel="noopener noreferrer">
                        数促中心门户
                    </a>
                    &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
                    <a>
                        要素赋能大市场
                    </a>
                    &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
                    <a id="go-other-link3" target="_blank" rel="noopener noreferrer">
                        产业互联网平台
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="container header wow fadeInLef">
    <div class="row">
        <div class="col col-lg-6">
            <div class="nav">
                <#if calias=='default'>
                <a class="link" href="${Site.link}">
                    <div class="nav-item nav-item-active" >首页</div>
                </a>
                <#else>
                <a class="link" href="${Site.link}">
                    <div class="nav-item" >首页</div>
                </a>
                </#if>

                <@cms_catalog alias="hqzc" level="Self" size="1">
                    <#list DataList as c1>
                        <#if calias=='hqzc'>
                        <a href="${c1.link}">
                            <div class="nav-item nav-item-active" >${c1.name}</div>
                        </a>
                        <#else>
                        <a href="${c1.link}">
                            <div class="nav-item" >${c1.name}</div>
                        </a>
                        </#if>
                    </#list>
                </@cms_catalog >

                <@cms_catalog alias="zcjd" level="Self" size="1">
                    <#list DataList as c1>
                        <#if calias=='zcjd'>
                        <a href="${c1.link}">
                            <div class="nav-item nav-item-active" >${c1.name}</div>
                        </a>
                        <#else>
                        <a href="${c1.link}">
                            <div class="nav-item" >${c1.name}</div>
                        </a>
                        </#if>
                    </#list>
                </@cms_catalog >

                <@cms_catalog alias="zcjsq" level="Self" size="1">
                    <#list DataList as c1>
                        <#if calias=='zcjsq'>
                        <a href="${c1.link}">
                            <div class="nav-item nav-item-active" >${c1.name}</div>
                        </a>
                        <#else>
                        <a href="${c1.link}">
                            <div class="nav-item" >${c1.name}</div>
                        </a>
                        </#if>
                    </#list>
                </@cms_catalog >
            </div>
        </div>
        <div class="col col-lg-6">
            <div class="search">
                <input autocomplete="off" class="my-input" id="header_search" type="text" placeholder="请输入关键字查询" style="width: 320px;">
                <button class="my-button" id="btn-search" type="default">搜索</button>
                <button class="my-button" id="btn-reset" type="primary">重置</button>
            </div>
        </div>
    </div>
</div>
